#ifndef DOOR_CONTROL_H
#define DOOR_CONTROL_H

#include <QObject>
#include "qtimer.h"
#include "door.h"
#include "warn.h"

class door_control : public QObject
{
    Q_OBJECT
public:
    explicit door_control(QObject *parent = 0);
    ~door_control();

    void cmd_open_front_door();
    void cmd_close_front_door();
    void cmd_halt_door();
    void cmd_open_back_door();
    void cmd_close_back_door();
    bool rise_edge_true(bool input);
    bool down_edge_true(bool input);
    bool pulse_true(bool &a,bool &b,bool &c,bool input);

    bool repair_mode;
    QTimer * testtimer;
signals:

public slots:
    void timeDone();
    void test_timeout();
    void door_near_timeDone();
private:
  QTimer *timer;
  QTimer *door_near_timer;
  door* front_door;
  door* back_door;
  warn* front_door_warn;
  warn* back_door_warn;
  bool test;//C++对象排列问题，排列不整齐，读取出错

};

#endif // DOOR_CONTROL_H
